/**
 * FileFind - ftp/shares indexing and search php engine
 * Module: agent-java
 * Description: Agent written in java language
 * Copyright (c) 2003-2010 Rage Steel, www.gt2.ru
 * ----------------------------------------------
 * $Id$
 */
package ru.ffind.agent.io;

import java.io.File;

import ru.ffind.common.model.Directory;
import ru.ffind.common.model.Entry;

import com.google.common.collect.ImmutableList;

/**
 *
 * Directory item for errors
 *
 * @author Rage Steel
 *
 */
public class ErrorDirectory extends AbstractFileEntry implements Directory {

	/* (non-Javadoc)
	 * @see ru.ffind.agent.io.Directory#isError()
	 */
	@Override
	public boolean isError() {
		return true;
	}
	
	private ErrorDirectory(File directory) {
		super(directory);
	}
	
	public static ErrorDirectory create(File directory) {
		return new ErrorDirectory(directory);
	}

	/* (non-Javadoc)
	 * @see ru.ffind.agent.io.Directory#getCount()
	 */
	@Override
	public long getCount() {
		return 0;
	}

	/* (non-Javadoc)
	 * @see ru.ffind.agent.model.Directory#getListing()
	 */
	@Override
	public ImmutableList<Entry> getEntries() throws UnsupportedOperationException {
		throw new UnsupportedOperationException("Directories with errors has no listings");
	}

	/*
	@Override
	public boolean equals(Object obj) {
		return AbstractEntry.dirEquals(this, obj);
	}
	*/


}
